home *** CD-ROM | disk | FTP | other *** search
/ Aminet 37 / Aminet 37 (2000)(Schatztruhe)[!][Jun 2000].iso / Aminet / util / cli / sploinerwos.lha / source.lha / sploiner.c < prev    next >
C/C++ Source or Header  |  1995-11-30  |  1KB  |  56 lines

  1. /* Copyright: Richard Joergensen                             */
  2. /* Internet: ric@daimi.aau.dk (at last until summer 1995)    */
  3. /* Disclaimer: I take NO responsibilities for this program.  */
  4. /* Any use is on your own risk.                              */
  5.  
  6. #include "common.h"
  7. #include "split.h"
  8. #include "join.h"
  9. #include "repair.h"
  10.  
  11. /* This is a versionstring for use with the Amiga-program "version" */
  12. const char Version[]="$VER: Sploiner 1.01 ("__DATE__" "__TIME__")\0";
  13.  
  14. char *prgname;
  15.  
  16. int main(int argc, char *argv[])
  17. {
  18.   prgname = *argv++;
  19.   if (argc-- < 2) usage();
  20.  
  21.   if (strcmp(*argv,"split")==0)
  22.     split(--argc, ++argv);
  23.   else if (strcmp(*argv,"join")==0)
  24.     join(--argc, ++argv);
  25.   else if (strcmp(*argv,"repair")==0)
  26.     repair(--argc, ++argv);
  27.   else if (strcmp(*argv,"example")==0)
  28.     usage_example();
  29.   else usage();
  30.   return 0;
  31. }
  32.  
  33. int FileSize(FILE *fp)
  34. {
  35.   long size, pos=ftell(fp);
  36.   
  37.   fseek(fp,0,SEEK_END);      /* Goto EOF */
  38.   size=ftell(fp);            /* Read position */
  39.   fseek(fp,pos,SEEK_SET);    /* Goto old position */
  40.   return(size);
  41. }
  42.  
  43. void OutputName(char *name, char *outfile)
  44. {
  45.   int ext;
  46.   
  47.   for(ext=0 ; ((outfile[ext]=name[ext]) != '\0') ; ext++);
  48.  
  49.   outfile[ext]='.';
  50.   outfile[ext+1] = '0';
  51.   outfile[ext+2] = '0';
  52.   outfile[ext+3] = '0';
  53.   outfile[ext+4] = '\0';
  54. }
  55.  
  56.